babl-internal: tidy up some log messages
authorØyvind Kolås <pippin@gimp.org>
Tue, 13 Jun 2017 07:23:43 +0000 (09:23 +0200)
committerØyvind Kolås <pippin@gimp.org>
Tue, 13 Jun 2017 07:26:11 +0000 (09:26 +0200)
babl/babl-internal.h

index 42262d6b0b3ff0f1b51c088f50895271fec8651e..b55249b560dabee027321a93fe2214dcb85d4b80 100644 (file)
@@ -265,22 +265,18 @@ BABL_CLASS_MINIMAL_IMPLEMENT(klass)                           \
 const Babl *                                                  \
 babl_##klass (const char *name)                               \
 {                                                             \
-  Babl *babl = NULL;                                          \
+  Babl *babl;                                                 \
                                                               \
   if (babl_hmpf_on_name_lookups)                              \
     {                                                         \
-      babl_log ("%s(\"%s\"): hmpf!", G_STRFUNC, name);        \
+      babl_log ("%s(\"%s\"): looking up", G_STRFUNC, name);   \
     }                                                         \
+  if (!db)                                                    \
+    {                                                         \
+      babl_fatal ("%s(\"%s\"): you must call babl_init first", G_STRFUNC, name);  \
+    }                                                         \
+  babl = babl_db_exist_by_name (db, name);                    \
                                                               \
-  if( db != NULL )                                            \
-   {                                                          \
-     babl = babl_db_exist_by_name (db, name);                \
-   }                                                          \
- else{                                                        \
-   babl_fatal("You must call babl_init() first");             \
- }                                                           \
-                                                              \
-                                                             \
   if (!babl)                                                  \
     {                                                         \
       babl_fatal ("%s(\"%s\"): not found", G_STRFUNC, name);  \